package com.wzdigit.wms.basic.enums.task;
/*
 * @Author:yangwenbiao
 * @Date 2020/7/30 5:46 PM
 * @version 1.0
 */


import com.wzdigit.wms.basic.enums.BaseEnum;

/**
 * 任务状态枚举
 */
public enum TaskLogStatusEnum implements BaseEnum {

    /**
     * 任务状态
     */
    TASK_LOG_STATUS_NEW(101, "新建","任务状态"),
    TASK_LOG_STATUS_END(102, "结束","任务状态");


    /**
     * 枚举值
     */
    public int code;

    /**
     * 枚举名称
     */
    public String enumName;

    /**
     * 枚举实体类属性描述
     *
     * @return
     */
    public String description;

    TaskLogStatusEnum(int code, String enumName) {
        this.code = code;
        this.enumName = enumName;
    }

    TaskLogStatusEnum(int code, String enumName, String description) {
        this.code = code;
        this.enumName = enumName;
        this.description = description;
    }

    public int getCode() {
        return code;
    }

    public  final String getEnumName() {
        return enumName;
    }

    public String getDescription() {
        return description;
    }

    public static TaskLogStatusEnum getEnumByCode(int enumCode) {
        TaskLogStatusEnum[] values = TaskLogStatusEnum.values();
        TaskLogStatusEnum repairEnum = null;

        for (TaskLogStatusEnum value : values) {
            if (value.getCode() == enumCode) {
                repairEnum = value;
            }
        }
        return repairEnum;
    }

    public static TaskLogStatusEnum getEnumByName(String enumName) {
        TaskLogStatusEnum[] values = TaskLogStatusEnum.values();
        TaskLogStatusEnum repairEnum = null;

        for (TaskLogStatusEnum value : values) {
            if (value.getEnumName().equals(enumName)) {
                repairEnum = value;
            }
        }
        return repairEnum;
    }
}
